﻿package plugin.npcDialog.ui.panels.boss
{
    import cmd.*;
    import com.core.*;
    import consts.*;
    import flash.events.*;
    import manager.*;
    import plugin.newvip.model.*;
    import pluginfw.nio.*;
    import uiresource.npcdialogs.*;

    public class BossCtrl extends BossUI implements INpcDialogContent
    {
        private var _data:Object;

        public function BossCtrl()
        {
            return;
        }// end function

        public function close() : void
        {
            if (this.parent)
            {
                this.parent.removeChild(this);
            }
            return;
        }// end function

        public function show(param1:Object, param2:Object) : void
        {
            this._data = param1;
            return;
        }// end function

        override protected function initializeView() : void
        {
            super.initializeView();
            Link_jinru.addEventListener(MouseEvent.CLICK, this.clickHandler);
            ModelProxy.change("guideitem", "guideid" + GuideType.GUIDE_BS2, Link_jinru);
            return;
        }// end function

        protected function clickHandler(event:MouseEvent) : void
        {
            ModelProxy.change("guide", "hide", GuideType.GUIDE_BS2);
            var _loc_2:* = ConfigDictionary.data.deliver[this._data.npcid][0];
            if (_loc_2.level > UserData.getUserData("level"))
            {
                WarningManager.show(32, [_loc_2.level]);
                return;
            }
            if (VipCheck.checkVipLevel() <= 0)
            {
                WarningManager.show(34, ["成为vip1"]);
                return;
            }
            var _loc_3:* = new Output();
            _loc_3.writeVarInt(_loc_2.stageid, false);
            _loc_3.writeVarInt(_loc_2.x, false);
            _loc_3.writeVarInt(_loc_2.y, false);
            PluginManager.instance.sendToBufferServer("activity", CMDActivity.IntoBossInstance, _loc_3);
            return;
        }// end function

        public function update(param1:Object, param2:int = 0) : void
        {
            return;
        }// end function

    }
}
